#ifndef _FPGA_INTERFACE_
#define _FPGA_INTERFACE_

#include <unistd.h>
#include <stdint.h>
#include <linux/types.h>
#include <stdlib.h>
#include <stdio.h>

#include "spidev_interface.h"

int fpga_init(uint16_t ch);
int close_fpga(uint16_t ch);
void spi_write_fpga(uint16_t page, size_t offset, uint16_t val);
uint16_t spi_read_fpga(uint16_t page, size_t offset);
int read_fpga_ddr(uint32_t addr, size_t len, uint8_t *data, uint16_t ch);
int write_fpga_ddr(uint32_t addr, uint32_t len, uint8_t *data);
void set_flowctrl_mode(uint16_t val);

#endif // #ifdef _FPGA_INTERFACE_